package xml;
import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

@XmlRootElement(name="items")
public class ContenedorItemXML implements Serializable {

	private List<ItemSolicitudXML> items;

	public List<ItemSolicitudXML> getItems() {
		return items;
	}

	@XmlElement(name="articulo")
	public void setItems(List<ItemSolicitudXML> items) {
		this.items = items;
	}

	public ContenedorItemXML() {
		super();
		// TODO Auto-generated constructor stub
		this.items = new ArrayList<ItemSolicitudXML>();
	}
	
	public void addArticulo(String nroArticulo, int cantidad) {
		if(this.items == null){
			this.items = new ArrayList<ItemSolicitudXML>();
		}
		this.items.add(new ItemSolicitudXML(nroArticulo, cantidad));
	}
	
	public void addArticulo(ItemSolicitudXML item) {
		if(this.items == null){
			this.items = new ArrayList<ItemSolicitudXML>();
		}
		this.items.add(item);
	}
	
}
